class CreateBlogs < ActiveRecord::Migration
  def self.up
    create_table :blogs do |t|
      t.column(:title, :string)
      t.column(:content, :text)
      t.column(:created_at, :datetime)
      t.column(:view_count, :integer,:default=>0)
      t.column(:comments_count, :integer,:default=>0)
      t.column(:category_id, :integer)
    end
  end

  def self.down
    drop_table :blogs
  end
end
